package util.chessworld;

import util.chessworld.util.Vectors;
import util.chessworld.util.Dot;
import util.IConstant;

public class Avatar implements IConstant {

    private Dot position;
    private Domain domaine;
    private int trait;

    public Avatar(Domain dom) {
        domaine = dom;
        position = Origine;
    }

    public boolean moveTo(int step, Vectors direction) {
        position.setX(position.X() + step * direction.U());
        position.setY(position.Y() + step * direction.V());
        return new Collision(this).testObstacle();

    }

    public int trait() {
        return trait;
    }

    public int X() {
        return position.X();
    }

    public int Y() {
        return position.Y();
    }

    public void setPosition(Dot position) {
        this.position = position;
    }

    public Domain getDomaine() {
        return domaine;
    }

    @Override
    public String toString() {
        return position.toString();
    }
}
